# -*- coding:utf-8 -*-
from selenium import webdriver
from time import sleep
import csv

url = 'https://bj.58.com/zpshengchankaifa/?PGTID=0d100000-0000-160a-2325-bda293b930bf&ClickID=2'


def writecsv(item):
    with open('工程建设01.csv', 'a', encoding='utf-8', newline='') as f:
        wir = csv.writer(f)
        try:
            wir.writerow(item)
        except:
            print('error')


driver = webdriver.Chrome(r'E:\Google\chromedriver.exe')

driver.get(url)

a_list = driver.find_elements_by_xpath('//*[@id="list_con"]/li')
sleep(1)
for i in a_list:
    print(i.text)
sleep(1)



